<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center"><div class="table-first-id">ID</div></th>
            <th class="text-center" width="11%">讲师名称</th>
            <th class="text-center" width="20%">隶属专业/隶属科目</th>
            <th class="text-center" width="10%">后台账号</th>
            <th class="text-center" width="10%">创建人</th>
            <th class="text-center" width="12%">创建时间</th>
            <th class="text-center" width="8%">讲师性质</th>
            <th class="text-center" width="8%">讲师身份</th>
            <th class="text-center" width="6%">状态</th>
            <th class="text-center" width="10%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody>
            <tr class="jqgfirstrow" role="row">
                <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                <th class="text-center" width="11%">&nbsp;</th>
                <th class="text-center" width="20%">&nbsp;</th>
                <th class="text-center" width="10%">&nbsp;</th>
                <th class="text-center" width="10%">&nbsp;</th>
                <th class="text-center" width="12%">&nbsp;</th>
                <th class="text-center" width="8%">&nbsp;</th>
                <th class="text-center" width="8%">&nbsp;</th>
                <th class="text-center" width="6%">&nbsp;</th>
                <th class="text-center" width="10%">&nbsp;</th>
            </tr>
            <tr th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                <td colspan="10" class="text-center">
                    <div class="noDataTipsBox">
                        <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                    </div>
                </td>
            </tr>
            <tr th:if="!${#maps.isEmpty(dataMap)} and !${#lists.isEmpty(dataMap['list'])}" th:each="teacher : ${dataMap['list']}" th:attr="id='teacher-'+${teacher.id}" th:attrappend="data-name=${teacher.teacherName}">
                <td >
                    <input type="checkbox" class="i-checks" name="teacherId" th:value="${teacher['id']}" />
                    <th:block th:text="${teacher['id']}"></th:block>
                </td>
                <td class="text-left" th:attr="id='teacher-name-'+${teacher['id']}">
                    <img th:attrappend="data-original=!${#maps.isEmpty(teacher['imageMap'])}? ${teacher['imageMap']['pcUrlMap']['large']} :''" width="30" height="30" style="max-width:100px" class="img-circle lazy" th:text="'&nbsp'+${teacher['teacherName']}"/>
                </td>
                <td class="text-center">
                    <th:block th:if="!${#lists.isEmpty(teacher['subjectList'])}">
                        <span class="pie" th:each="subject,subIndex : ${teacher['subjectList']}">
                            <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                            <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                            </th:block>
                            <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                            <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                        </span>
                    </th:block>
                    <th:block th:if="${#lists.isEmpty(teacher['subjectList'])}">
                        <span class="pie">—</span>
                    </th:block>
                </td>
                <td class="text-center">
                    <span th:if="${teacher['sysUser']}!=null" th:text="${teacher['sysUser']['username']}"></span>
                    <span th:if="${teacher['sysUser']}==null">—</span>
                </td>
                <td class="text-center">
                    <span th:if="${teacher['sysCreateUser']}!=null" th:text="${teacher['sysCreateUser']['username']}"></span>
                    <span th:if="${teacher['sysCreateUser']}==null">—</span>
                </td>
                <td class="text-center" th:text="${#strings.substring(teacher['createTime'],0,16)}">
                </td>
                <td class="text-center">
                    <span th:if="${teacher['teacherType']}==1">平台自有</span>
                    <span th:if="${teacher['teacherType']}==2">入驻讲师</span>
                </td>
                <td class="text-center" th:attr="id='teacher-identity-'+${teacher['id']}" >
                    <span th:if="${teacher['teacherIdentity']==null}">-</span>
                    <span th:if="${#strings.contains(teacher['teacherIdentity'],'1')}">讲师&nbsp;</span>
                    <span th:if="${#strings.contains(teacher['teacherIdentity'],'2')}">&nbsp;班主任</span>
                </td>
                <td class="text-center" th:attr="id='teacher-status-'+${teacher['id']}">
                    <span th:if="${teacher['status']}==0" class="label label-default">待补充</span>
                    <span th:if="${teacher['status']}==1" class="label label-info">正常</span>
                    <span th:if="${teacher['status']}==2" class="label label-danger">冻结</span>
                </td>
                <td class="text-center">
                    <a th:href="@{/admin/manage/teacher/teacherInfo?teacherId={teacherId}(teacherId=${teacher['id']})}" class="teacher-check-btn c-master fs14" th:attr="data-id=${teacher['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                        <i class="fa fa-eye"></i>
                    </a>
                    <a th:href="@{/admin/manage/teacher/initUpdate?id={id}(id=${teacher['id']})}" class="c-master fs14 ml5" th:attr="data-id=${teacher['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="修改">
                        <i class="fa fa-edit"></i>
                    </a>
                    <a th:if="${teacher['status']}==1" href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${teacher['id']}" th:attrappend="id='teacher-updateStatus-btn-'+${teacher['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="冻结">
                        <i class="fa fa-unlock-alt"></i>
                    </a>
                    <a th:if="${teacher['status']}==2" href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${teacher['id']}" th:attrappend="id='teacher-updateStatus-btn-'+${teacher['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复">
                        <i class="fa fa-history"></i>
                    </a>
                    <a href="javascript:void(0);" class="teacher-delete-btn c-master fs14 ml5" th:attr="data-id=${teacher['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                        <i class="fa fa-trash-o"></i>
                    </a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>
</html>

